package threading;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ws
 * Date: 2023-07-03
 * Time: 20:44
 */
public class ThreadDemo11 {
    public static void main(String[] args) throws InterruptedException {
        Thread t = new Thread(() -> {
            System.out.println("Hello t");
        });

        t.start();
        //在main线程中调用t.join()，就是让main线程等待t线程执行结束（保证t先结束）
        //其他线程不受影响
        t.join();

        System.out.println("Hello main");
    }
}
